from core.basehandler import BaseHandler
from core.room import Room
# from items.keys import Keys
from core.action import Action
from core.support import set_cutscene

class tables(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # add inventory items
        # self.add_item(Keys())
        
        # build list of actions

        self.add_action(bar)
        self.add_action(dancefloor)
        self.add_action(food)
        self.add_action(chitchat)
    
    # return description of room.
    def get_description(self):
        return "Welcome to the cool kids table...play it cool and grab a good seat"
    
    # return image of room
    def get_image(self):
        return 'tables.jpg'


class TablesHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return tables

# define actions for this room

class bar(Action):
    def __init__(self):
        Action.__init__(self, "bar")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to the Bar"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'bar'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
class dancefloor(Action):
    def __init__(self):
        Action.__init__(self, "dancefloor")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Hit the Dance Floor"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'dancefloor'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"

    
class food(Action):
    def __init__(self):
        Action.__init__(self, "food")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to the Buffet"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'food'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"

class chitchat(Action):
    def __init__(self):
        Action.__init__(self, "chitchat")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Chit Chat with Table Mates"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'tables'
    
    def do_action(self,game,room,request):
        set_cutscene("While making chit chat with your table mates, you learn that Cynthia is from Cincinnati, Tom is from Tampa, and Mary is from Mobile. You gain an interaction point. Nice job.")
        game.social+=1
        self.usable = False
        return
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
